<template>
	<view @touchmove.prevent.stop="disableScroll">

		<!-- 普通弹窗 -->
		<uni-popup ref="popup" background-color="#fff" @change="change">
			<view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }"
				@touchmove.prevent.stop="disableScroll">
				<view class="popup-x-body" v-if="diskInfo">
					<card-involve-list :diskInfo="diskInfo"></card-involve-list>
				</view>
			</view>
		</uni-popup>
	</view>
</template>

<script>
	import simpleCache from '../../utils/Simple-Cache';
	export default {
		name: "disk-info-popup",
		data() {
			return {
				type: 'center',
				show: false, //控制不让它穿透
			}
		},
		mounted() {},
		props: ['diskInfo'],
		watch: {
			'diskInfo': function(n) {
				console.log(n);
			}
		},
		methods: {
			change(e) {
				let that = this
				if (e.show == true) {
					//打开了网盘信息面板 12小时后可再次获取
					simpleCache.put('downcount', 1, 60 * 60 * 12)
					uni.showToast({
						title: `请复制网盘地址到${this.diskInfo.type}下载`,
						duration: 2500,
						icon: "none",
						success() {
							that.$emit('getDiskPopUpIsShow', e)
						}
					})
				}
				console.log('当前模式：' + e.type + ',状态：' + e.show, simpleCache.get('downcount'));

			},
			toggle(type) {
				this.type = type
				// open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
				this.$refs.popup.open(type)
			},
			close() {
				this.$refs.popup.close()
			},
			disableScroll() {
				return false
			}
		}
	}
</script>

<style lang="less">
	.popup-content {
		display: flex;
		align-items: center;
		justify-content: center;
		padding: 15px;
		border-radius: 20rpx;
		background-color: #fff;
	}
</style>


</style>
